Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tls: Typesafe tls slots #13789

Merged
merged 10 commits into from
Oct 29, 2020
Merged

Conversation

jmarantz
Copy link
Contributor

@jmarantz jmarantz commented Oct 28, 2020

Commit Message: Adds a new TypedSlot API, where the slot data is strongly typed. Also removes an unused capability to replace slot data with a new instance via the callbacks in runOnAllThreads.

Use this new API rather than the untyped Slot API for one of the sites (stats thread_local_store.cc).

This is a partial fix for #13313
Risk Level: low
Testing: //test/...
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Copy link
Contributor Author

@jmarantz jmarantz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattklein123 ptal -- this is not ready to go yet -- needs unit tests and covering the other existing dynamically typed uses of Tls::SlotPtr, but I wanted to see if you liked the pattern before I use it everywhere.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
@mattklein123 mattklein123 self-assigned this Oct 28, 2020
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Happy to continue in this direction.

/wait

include/envoy/thread_local/thread_local.h Outdated Show resolved Hide resolved
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
@mattklein123
Copy link
Member

Thanks in general this LGTM. Do you want to do all sites? Or just land this first and then do some further PRs?

/wait

@jmarantz
Copy link
Contributor Author

I think I'll try to get this in first and then iterate on the rest of the sites. But first I want to survey the existing sites to see if there's any gap in usage. In particular I am interested in cases where we are returning a new value from the runOnAllThreads lambda.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz jmarantz marked this pull request as ready for review October 28, 2020 19:17
@jmarantz jmarantz requested a review from snowp as a code owner October 28, 2020 19:17
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks this is nice! Just a few small comments.

/wait

include/envoy/thread_local/thread_local.h Show resolved Hide resolved
include/envoy/thread_local/thread_local.h Outdated Show resolved Hide resolved
source/extensions/clusters/aggregate/cluster.cc Outdated Show resolved Hide resolved
…us misc comments.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks. @akonradi any other comments?

Copy link
Contributor

@akonradi akonradi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice! Just the one nit

include/envoy/thread_local/thread_local.h Show resolved Hide resolved
@jmarantz
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #13789 (comment) was created by @jmarantz.

see: more, trace.

@jmarantz jmarantz merged commit b9398f3 into envoyproxy:master Oct 29, 2020
@jmarantz jmarantz deleted the typesafe-tls-slots branch October 29, 2020 16:36
mpuncel added a commit to mpuncel/envoy that referenced this pull request Oct 30, 2020
* master: (83 commits)
  tls: Typesafe tls slots (envoyproxy#13789)
  docs(example): Correct URL for caching example page (envoyproxy#13810)
  [fuzz] Made health check fuzz more efficient (envoyproxy#13747)
  rtds: properly scope rtds stats (envoyproxy#13764)
  http: fixing a bug with IPv6 hosts (envoyproxy#13798)
  connection: Remember transport socket read resumption requests and replay them when re-enabling read. (envoyproxy#13772)
  network: adding some accessors for ALPN work. (envoyproxy#13785)
  docs: added a step about how to handle platform specific extensions (envoyproxy#13759)
  Fix identation in ip transparency code snippet (envoyproxy#13743)
  wasm: enable WAVM's stack unwinding feature (envoyproxy#13792)
  log: set route name for direct response (envoyproxy#13683)
  Use nghttp2 as external dependsncy in protocol_constraints_lib (envoyproxy#13763)
  [Windows] Update windows dev docs (envoyproxy#13741)
  cel: patch thread safety issue (envoyproxy#13739)
  Windows: Fix ssl_socket_test (envoyproxy#13264)
  apple dns: add fake api test suite (envoyproxy#13780)
  overload: scale selected timers in response to load (envoyproxy#13475)
  examples: Add dynamic configuration (control plane) sandbox (envoyproxy#13746)
  Removed exception in getResponseStatus() (envoyproxy#13314)
  network: add timeout for transport connect (envoyproxy#13610)
  ...

Signed-off-by: Michael Puncel <mpuncel@squareup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants